﻿using System;

namespace Informant.Clients.DataProviders
{
	public class LogOnCompletedEventArgs : EventArgs
	{
		private static LogOnCompletedEventArgs _empty;

		/// <summary>
		/// Initializes a new instance of the <see cref="LogOnCompletedEventArgs"/> class.
		/// </summary>
		/// <param name="succeeded">if set to <c>true</c> [succeeded].</param>
		/// <param name="errorMessage">The error message.</param>
		public LogOnCompletedEventArgs(Boolean succeeded, String errorMessage)
		{
			Succeeded = succeeded;
			ErrorMessage = errorMessage;
		}

		/// <summary>
		/// Gets the empty.
		/// </summary>
		/// <value>The empty.</value>
		public new LogOnCompletedEventArgs Empty
		{
			get
			{
				if (_empty == null)
				{
					_empty = new LogOnCompletedEventArgs(false, null);
				}
				return _empty;
			}
		}
		/// <summary>
		/// Gets or sets a value indicating whether this <see cref="LogOnCompletedEventArgs"/> is succeeded.
		/// </summary>
		/// <value><c>true</c> if succeeded; otherwise, <c>false</c>.</value>
		public Boolean Succeeded { get; private set; }
		public String ErrorMessage { get; private set; }
	}
}
